﻿using System;
using System.Collections.Generic;
using System.Text;

namespace NRemedy
{
    public class FieldValueSet : IDictionary<string,object>
    {
        public Dictionary<string, object> innerFieldValueSet;

        public FieldValueSet()
        {
            innerFieldValueSet = new Dictionary<string, object>();
        }

        public void Add(string key, object value)
        {
            innerFieldValueSet.Add(key, value);
        }

        public bool ContainsKey(string key)
        {
            return innerFieldValueSet.ContainsKey(key);
        }

        public ICollection<string> Keys
        {
            get { return innerFieldValueSet.Keys; }
        }

        public bool Remove(string key)
        {
            return innerFieldValueSet.Remove(key);
        }

        public bool TryGetValue(string key, out object value)
        {
            return innerFieldValueSet.TryGetValue(key, out value);
        }

        public ICollection<object> Values
        {
            get { return innerFieldValueSet.Values; }
        }

        public object this[string key]
        {
            get
            {
                return innerFieldValueSet[key];
            }
            set
            {
                innerFieldValueSet[key] = value;
            }
        }

        public void Add(KeyValuePair<string, object> item)
        {
            ((IDictionary<string, object>)innerFieldValueSet).Add(item);
        }

        public void Clear()
        {
            innerFieldValueSet.Clear();
        }

        public bool Contains(KeyValuePair<string, object> item)
        {
            return ((IDictionary<string, object>)innerFieldValueSet).Contains(item);
        }

        public void CopyTo(KeyValuePair<string, object>[] array, int arrayIndex)
        {
            ((IDictionary<string, object>)innerFieldValueSet).CopyTo(array, arrayIndex);
        }

        public int Count
        {
            get { return innerFieldValueSet.Count; }
        }

        public bool IsReadOnly
        {
            get { return ((IDictionary<string, object>)innerFieldValueSet).IsReadOnly; }
        }

        public bool Remove(KeyValuePair<string, object> item)
        {
            return ((IDictionary<string, object>)innerFieldValueSet).Remove(item);
        }

        public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
        {
            return innerFieldValueSet.GetEnumerator();
        }

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            return ((System.Collections.IEnumerable)innerFieldValueSet).GetEnumerator();
        }
    }
}
